package easy

func DistanceTraveled(mainTank int, additionalTank int) int {
	return 10 * (mainTank + min((mainTank-1)/4, additionalTank))
}

func DistanceTraveled1(mainTank int, additionalTank int) int {
	ans := 0
	for mainTank >= 5 {
		mainTank -= 5
		ans += 50
		if additionalTank > 0 {
			additionalTank--
			mainTank++
		}
	}
	return ans + mainTank*10
}
